package panel.common;

import Base.DScrollPane;

import javax.swing.*;


public class MessagePanel extends DScrollPane {
    public static int widthIntercept = 8;

    public MessagePanel() {
        super();
    }
    public void addMessage(JPanel panel, boolean isMe) {
        int x = isMe ? getWidth() - panel.getWidth() - widthIntercept : widthIntercept;
        panel.setLocation(x, panel.getY());
        addComp(panel);
    }
}
